<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:65:"E:\phpCloud\ruanlink\public/../app/spadmin\view\index\dashed.html";i:1729672732;s:54:"E:\phpCloud\ruanlink\app\spadmin\view\public\base.html";i:1732971886;}*/ ?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
		<title>后台管理系统</title>
		<!-- 样 式 文 件 -->
		<link rel="stylesheet" href="/assets/library/core/css/core.css?v=<?php echo config('version'); ?>" />
        
	</head>
    <!-- 代 码 结 构 -->
	
<body class="pear-container">
	<div class="layui-card">
		<div class="layui-card-body">
			<form class="layui-form" action="">
                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">订单号</label>
                    <div class="layui-input-inline">
                        <input type="text" name="keywords" placeholder="用户名|手机号" class="layui-input">
                    </div>
                </div>
                
                <div class="layui-form-item layui-inline">
                    <button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="table-query">
                        <i class="layui-icon layui-icon-search"></i>
                        查询
                    </button>
                    <button type="reset" class="pear-btn pear-btn-md">
                        <i class="layui-icon layui-icon-refresh"></i>
                        重置
                    </button>
                </div>
			</form>
		</div>
	</div>
	<div class="layui-card">
		<div class="layui-card-body">
			<table id="table-list" lay-filter="table-list"></table>
		</div>
	</div>
</body>

    <!-- 资 源 引 入 -->
		<script src="/assets/library/layui/layui.js?v=12<?php echo config('version'); ?>"></script>
		<script src="/assets/library/core/core.js?v=12<?php echo config('version'); ?>"></script>
		<script src="/static/js/qiniu.min.js?v=12<?php echo config('version'); ?>"></script>
	
	<script type="text/html" id="table-toolbar">
	</script>
	<script type="text/html" id="table-bar">
	</script>
	
    
<script type="text/html" id="table-status">
        {{#if (d.pay_status == 1){ }}
          <span style="color:green">已付款</span>
        {{# }else{ }}
          <span style="color:green">未付款</span>
        {{# } }}
</script>
<script type="text/html" id="user-group">
        {{#  if(d.id == 1 ){ }}
        <span class="layui-badge layui-bg-blue">超级管理员</span>
        {{# } else { }}

            {{# let tags = d.group?d.group.split(','):''}}
            {{# if (tags != ''){ }}
            {{# layui.each(tags, function(index, item){ }}
            <span class="layui-badge layui-bg-blue">{{ item }}</span>
            {{# }) }}
            {{# } }}
        {{# } }}
    </script>
<script type="text/html" id="pay_time">
  {{# if(d.pay_status == 1){ }}
        {{layui.util.toDateString(parseInt(d.last_login_time)*1000, 'yyyy-MM-dd HH:mm')}}
  {{# } }}
    </script>
<script type="text/html" id="create_time">
        {{layui.util.toDateString(d.create_time, 'yyyy-MM-dd HH:mm')}}
    </script>
<script>
    layui.use(['table', 'form', 'jquery', 'common', 'laydate'], function () {
        let laydate = layui.laydate;
        let table = layui.table;
        let form = layui.form;
        let $ = layui.jquery;
        let common = layui.common;
        let cols = [
            [{
                type: 'checkbox'
            },
            {
                title: '订单号',
                field: 'order_no',
                align: 'center',
                width: 200
            },
            {
                title: '订单额',
                field: 'amount',
                align: 'center',
                width: 200
            },
            {
              title: '支付方式',
              field: 'pay_name',
              align: 'center',
              width: 200
          },
            
            {
                title: '创建时间',
                field: 'create_time',
                align: 'center',
                templet: '#user-create_time'

            },
            {
                title: '状态',
                field: 'pay_status',
                align: 'center',
                templet: '#table-status'
            },
            {
              title: '支付时间',
              field: 'pay_time',
              align: 'center',
              templet: '#pay_time'
          }
            ]
        ]

        table.render({
            elem: '#table-list',
            url: '<?php echo url("dashed"); ?>',
            parseData: function(res){ 
            return {
            "code": res.code, //解析接口状态
            "msg": res.message, //解析提示文本
            "count": res.data.total, //解析数据长度
            "data": res.data.data //解析数据列表
            }},
            page: true,
            cols: cols,
            skin: 'line',
            toolbar: '#table-toolbar',
            defaultToolbar: []
        });
        form.on('submit(table-query)', function (data) {
            table.reload('table-list', {
                where: data.field
            })
            return false;
        });
        setInterval(function(){
            table.reload('table-list');
        },30000)       
    })
</script>

</html>
